#include <stdio.h>

int main() {
    int weight,excess,price;
    char urgent;
    scanf("%c %d",&urgent,&weight);
    if(urgent=='y'){
        price=5;
    }
    else{
        price=0;
    }
    price=price+4;
    excess=weight-1000;
    while (excess>0){
        price=price+3;
        excess=excess-500;
    }
    printf("express fee is %d",price);
    return 0;
}
